package com.example.onlinemarket.bean.mobile;

import com.example.onlinemarket.bean.Good;

import static com.example.onlinemarket.util.FileUtil.byte2image;
import static com.example.onlinemarket.util.FileUtil.prefixPath;

public class MobileOrderItem {
    public int orderId;//订单编号
    public int goodId;//鲜花编号
    public String goodName;//鲜花名
    public int goodNum;//订购数量
    public String imgPath;
    public double sellPrice;

    public MobileOrderItem(int orderId, Good good, int goodNum) {
        this.orderId = orderId;
        this.goodId = good.getGoodId();
        this.goodName = good.getGoodName();
        this.sellPrice = good.getSellPrice();
        String fileName  = good.getGoodId()+".jpg";
        String path = prefixPath+"good\\"+fileName;
        byte2image(good.getPhoto(), path);
        this.imgPath="/good/"+fileName;
        this.goodNum = goodNum;
    }
}
